unit Splash;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.TabControl,
  FMX.Objects, FMX.Gestures, System.Actions, FMX.ActnList;

type
  TFrmSplash = class(TForm)
    tbcSp: TTabControl;
    tbtm1: TTabItem;
    tbtm2: TTabItem;
    tbtm3: TTabItem;
    img1: TImage;
    Image1: TImage;
    img2: TImage;
    gstrmngrSp: TGestureManager;
    actlstSp: TActionList;
    act0: TChangeTabAction;
    act1: TChangeTabAction;
    act2: TChangeTabAction;
    procedure FormCreate(Sender: TObject);
    procedure tbcSpGesture(Sender: TObject; const EventInfo: TGestureEventInfo;
      var Handled: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FrmSplash: TFrmSplash;

implementation

{$R *.fmx}

procedure TFrmSplash.FormCreate(Sender: TObject);
begin
  tbcSp.Touch.GestureManager := Self.gstrmngrSp;
  tbcSp.Touch.StandardGestures := [TStandardGesture.sgLeft, TStandardGesture.sgRight];
end;

procedure TFrmSplash.tbcSpGesture(Sender: TObject; const EventInfo: TGestureEventInfo; var Handled: Boolean);
begin
  case EventInfo.GestureID of
    sgiLeft:
      begin
        case tbcSp.TabIndex of
          0:
            act1.ExecuteTarget(self);
          1:
            act2.ExecuteTarget(self);
        end;
      end;
    sgiRight:
      begin
        case tbcSp.TabIndex of
          2:
            act1.ExecuteTarget(self);
          1:
            act0.ExecuteTarget(self);
        end;
      end;
  end;
  Handled := true;
end;

end.
